#include <iostream>
#include <algorithm>
#include <string>
#include <cstring>
#include <vector>
#include <queue>
#include <tuple>
#include <unordered_map>

using namespace std;

#define int long long

// #define open
#ifndef open
#define LOG(format, ...) printf("\n-- [DEGUB]: " format "\n", ##__VA_ARGS__)
#else
#define debug(format, ...) ((void)0)
#endif

template <typename A, typename B>
std::ostream &operator<<(std::ostream &os, const std::pair<A, B> &p)
{
    return os << '(' << p.first << ", " << p.second << ')';
}

template <typename T_container, typename T = typename std::enable_if<!std::is_same<T_container, std::string>::value, typename T_container::value_type>::type>
std::ostream &operator<<(std::ostream &os, const T_container &v)
{
    os << '[';
    std::string sep;
    for (const T &x : v)
        os << sep << x, sep = ", ";
    return os << ']';
}

const int N = 1e6 + 10;

int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};

struct node
{
    int l;
    int r;
} v[N];

int a, b, c;

void sol()
{
    cin >> a >> b >> c;
    int min_n = std::min({a, b, c});

    int res = min_n * 2;
    b -= min_n;
    if(b > 1) res += b - 1;
    cout << res << '\n';
}

signed main()
{
    std::ios::sync_with_stdio(0), std::cin.tie(0), std::cout.tie(0);

    int q;
    cin >> q;

    while(q--)
    {
        sol();
    }

    
    return 0;
}